﻿<%@ Page Title="Create" Language="C#" MasterPageFile="~/Posts/Posts.master" AutoEventWireup="true" CodeFile="Create.aspx.cs" Inherits="Posts_Create" %>

<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <asp:Panel ID="pnlParent" CssClass="itemPanel" runat="server">
        <ul class="form">
            <li>
                <asp:Label ID="Label1" AssociatedControlID="lblParentName" Text="Parent Name" runat="server" />
                <asp:Label ID="lblParentName" runat="server" />
            </li>
            <li>
                <asp:Label ID="Label3" AssociatedControlID="lblParentPath" Text="Parent Path" runat="server" />
                <asp:Label ID="lblParentPath" runat="server" />
            </li>
        </ul>        
    </asp:Panel>
    <asp:Panel ID="pnlInsert" CssClass="itemPanel" runat="server">
        <asp:DetailsView ID="dvCreate" DataSourceID="dsPost" AutoGenerateRows="False" 
            DefaultMode="Insert" runat="server" ondatabound="dvCreate_DataBound" 
            oniteminserted="dvCreate_ItemInserted">
            <Fields>
                <acms:TextBoxField Required="False" HeaderText="Name" DataField="Name" />
                <acms:TextBoxField HeaderText="Display Name"  DataField="DisplayName"/>
                <acms:DropDownField HasEmptyValue="True" DataSourceId="dsTemplates" DataTextField="Name" DataValueField="Id" Required="False" HeaderText="Template" DataField="TemplateId" />
                <acms:TextAreaField DataField="Summary" HeaderText="Summary" Cols="100" 
                    Rows="5" />
                <acms:TextAreaField HeaderText="Notes" DataField="Notes" Cols="100" Rows="5" />
                <acms:CommandField ShowHeader="false" ItemStyle-CssClass="buttons" 
                    CausesValidation="False" Text="Create Post" CommandName="Insert">
                </acms:CommandField>
            </Fields>
        </asp:DetailsView>
    </asp:Panel>
    <asp:Panel ID="pnlRootExists" CssClass="itemPanel" Visible="false" runat="server">
        There is already a Home page for this site. Please use the tree to select a parent post.
    </asp:Panel>
    <asp:Panel ID="pnlNoParent" CssClass="itemPanel" Visible="false" runat="server">
        The parent for this post cannot be found. Please use the tree to select a parent post.
    </asp:Panel>
    <asp:Panel ID="pnlNoTemplate" CssClass="itemPanel" Visible="false" runat="server">
        The parent template for this post does not allow children.
    </asp:Panel>
    <acms:PostDataSource ID="dsPost" runat="server" 
        onupdatingdata="dsPost_UpdatingData" />
    <acms:TemplateDataSource ID="dsTemplates" runat="server" 
        onselectdata="dsTemplates_SelectData" />
</asp:Content>